#reference: http://code.google.com/p/sanjhachoolha/wiki/URLPatterns
#url patterns for sanjhachoolha

from django.conf.urls.defaults import *
from sanjhachoolha.views import LatestEntries

feeds = {
    'latest': LatestEntries,
}


urlpatterns = patterns(
#the package name sanjhachoolha is important in the line below.
    'sanjhachoolha',
    (r'^$', 'views.index'),
    (r'^acton/add$', 'views.add'),
    (r'^acton/(?P<acton_id>\d+)/edit$', 'views.edit'),
    (r'^acton/(?P<acton_id>\d+)/remind$', 'views.addreminder'),
    (r'^acton/(?P<acton_id>\d+)/subscribe$', 'views.subscribe'),#BUG: my title can't be subscribe,edit,unsubscribe
    (r'^acton/(?P<acton_id>\d+)/unsubscribe$', 'views.unsubscribe'),
    (r'^acton/(?P<acton_id>\d+)/signup$', 'views.signup'),
    (r'^acton/(?P<acton_id>\d+)/leave$', 'views.leave'),
    (r'^acton/(?P<acton_id>\d+)/(?P<slug>[\w\-]*)$', 'views.show'),
    (r'^acton/(\d+)/unsubscribe$', 'views.unsubscribe'),
    (r'^acton/(?P<acton_id>\d+)/comments/add$', 'views.add_comment'),
    (r'^acton/(?P<acton_id>\d+)/comments/(?P<comment_id>\d+)/delete$', 'views.delete_comment'),
    (r'^users/(?P<user_id>\d+)$', 'views.showuser'),
    (r'^users/(?P<user_id>\d+)/setactoncreator$', 'views.setactoncreator'),
    (r'^users/(?P<user_id>\d+)/unsetactoncreator$', 'views.unsetactoncreator'),
    (r'^search$', 'views.search'),
    (r'^list/actons/(?P<last_id>\w*)$', 'views.listall'),
    (r'^list/tag/$', 'views.tag'),
    (r'^list/tag/(?P<tagName>[\w\-\s]*)$', 'views.tagName'),
    (r'^list/category/$', 'views.category'),
    (r'^list/category/(?P<categoryName>[\w\s\-]*)$','views.categoryName'),    
    (r'^listusers/(?P<last_id>\w*)$', 'views.listusers'),
    )
urlpatterns += patterns('',
    (r'^feeds/(?P<url>.*)/$', 'django.contrib.syndication.views.feed',
        {'feed_dict': feeds}),
    )
